<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<link rel="stylesheet" href="${ctx}/static/css/jquery-ui.min.css" />
	<title>新闻</title>
	<script src="${ctx}/static/js/jquery-ui.min.js"></script>
    <script>
      $(function () {
		  $('.popover-hide').popover('hide');

		  $('.show_msg').click(function (e) {
			  $("#div_tel").html("预留联系方式：" + $(this).children().eq(0).text());
			  $("#tt_msg").val($(this).children().eq(1).text());

			  var dialog = $("#dialog-msg").removeClass('hide').dialog({
				  modal: true,
				  height: 350, width: 500,
				  title: "反馈内容",
				  title_html: true,
				  buttons: [
					  {
						  text: "取消",
						  "class": "btn btn-xs",
						  click: function () {
							  $(this).dialog("close");
						  }
					  }
				  ]
			  });

		  });
	  });

    	  

   </script>
</head>

<body>	
	
	<div class="main-content-inner">
		<!-- #section:basics/content.breadcrumbs -->
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
	
			<ul class="breadcrumb">
				<li>
					<i class="ace-icon fa fa-home home-icon"></i>
					<a href="${ctx}/welcome">主页</a>
				</li>
				<li class="active">新闻</li>
			</ul><!-- /.breadcrumb -->
	
			<!-- #section:basics/content.searchbox -->
			<div class="nav-search" id="nav-search">
				<form class="form-search" action="${ctx}/news/list" method="GET">
<!-- 					<span class="input-icon"> -->
<%-- 						<input type="text" autocomplete="off" name="search_LIKE_user.name" placeholder="姓名 ..." class="nav-search-input" id="nav-search-input" autocomplete="off" value="${param['search_LIKE_user.name']}" /> --%>
<!-- 						<i class="ace-icon fa fa-search nav-search-icon" onclick="$('.form-search').submit();"></i> -->
<!-- 					</span> -->
					<span class="input-icon">
						<input type="text" autocomplete="off" name="search_EQ_mobile" placeholder="电话 ..." class="nav-search-input" id="nav-search-input" autocomplete="off" value="${param['search_EQ_mobile']}" />
						<i class="ace-icon fa fa-search nav-search-icon" onclick="$('.form-search').submit();"></i>
					</span>
					<!-- 
					<span class="input-icon">
						<select class="nav-search-input" id="news_deltag" name="search_EQ_deltag" data-placeholder="请选择状态">					
							<option value="0" <c:if test="${param.search_EQ_deltag eq '0' }">selected="selected"</c:if>>有用</option>
							<option value="1" <c:if test="${param.search_EQ_deltag eq '1' }">selected="selected"</c:if>>无用</option>
						</select>
					</span>
					 -->
					<input type="button" value="搜索" onclick = "$('.form-search').submit();" />
				</form>
			</div><!-- /.nav-search -->
	
			<!-- /section:basics/content.searchbox -->
		</div>	
		<!-- /section:basics/content.breadcrumbs -->
		
		<div class="page-content">
			
			<c:if test="${not empty message}">
				<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
			</c:if>	
			
			<div class="page-header">
				<h1>
					新闻管理
					<small>
						<i class="ace-icon fa fa-angle-double-right"></i>
						新闻列表
					</small>
				</h1>
				
			</div><!-- /.page-header -->			
			
			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label class="position-relative">
										<input type="checkbox" id="id-toggle-all" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>发布时间</th>
								<th>提交用户ID</th>
                                <th>内容</th>
                                <th>图片</th>
								<th>最新处理结果</th>
								<th>最新处理时间</th>
								<th>最新处理人</th>
								<th>操作</th>
							</tr>
						</thead>

						<tbody>
							<c:forEach items="${newss.content}" var="news">
								<c:if test="${news.deltag==0}">
								<tr>
									<td class="center">
										<label class="position-relative">
											<input type="checkbox" class="ace" />
											<span class="lbl"></span>
										</label>
									</td>

									<td>
										<fmt:formatDate value="${news.createtime}" pattern="yyyy-MM-dd  HH:mm:ss" />
									</td>
									<td>
											${news.userId}
									</td>
									<td class="show_msg" >
										<span style="display: none;">${news.fnTitle}</span>
										<span style="display: none;">${news.fnDesp}</span>
									</td>
									<td>
										<fmt:formatDate value="${news.updatetime}" pattern="yyyy-MM-dd  HH:mm:ss" />
									</td>

									<td align="left">
											<a class="btn btn-xs btn-danger" href="javaScript:reviewForm(${news.id});">
												处理
											</a>
											<!--
											<c:if test="${news.deltag eq '0' }">
											<shiro:hasPermission name="business:news:delete">
												<a class="btn btn-xs btn-danger" href="${ctx}/news/delete/${news.id}">
													无用信息
												</a>
											</shiro:hasPermission>
											</c:if>
											 -->
									</td>
									<td class="">
										<fmt:formatDate value="${news.updatetime}" pattern="yyyy-MM-dd  HH:mm:ss" />
									</td>
									<td class="">
											${news.userId}
									</td>
									<td class="">
										<a class="btn btn-xs btn-danger" href="${ctx}/news/delete/${news.id}">
											删除
										</a>
									</td>
								</tr>
								</c:if>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
			
			<div id="dialog-reviewForm" class="hide">
                <div class="form-group">
                    <div class="col-sm-9">
                    	<textarea id="tt_review" placeholder="请输入处理结果内容，最多50个汉字" rows="7" cols="60" maxlength="50"></textarea>
                    </div>
					<div id="div_reviews" class="col-sm-9" style="margin-top: 10px"></div>
                </div>
                <p>
                </p>
            </div>
            
            <div id="dialog-msg" class="hide">
                <div class="form-group">
                    <div class="col-sm-9">
                    	<textarea id="tt_msg" rows="7" cols="60"></textarea>
                    </div>
					<div id="div_tel" class="col-sm-9" style="margin-top: 10px">
					</div>
                </div>
                <p>
                </p>
            </div>
			
			<tags:pagination page="${newss}" paginationSize="5"/>
		</div><!-- /.page-content -->
	</div>
</body>
</html>
<!-- inline scripts related to this page -->	
